Skip to content

Hw7#12

Open
NosovDima wants to merge 13 commits into
masterfrom
hw7
Open

Hw7#12
NosovDima wants to merge 13 commits into
masterfrom
hw7

Conversation

@NosovDima
Copy link
Copy Markdown
Owner

Добрый день. ДЗ сделал, есть вопросы в комментариях

Comment thread hw7script.js
alert(arr);
}
});
// можно ли сделать одну функцию для всего массива?
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

да объяви функцию


function searchStart(arr, subString) {
   тут пиши весь код
}

Comment thread hw7script.js Outdated
building: ["Дом", "Банк", "Больница", "Театр"],
};
const search = "ко";
arr.forEach((arr) => {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

никогда не переназначай имя которые у тебя уже используются

arr.forEach((item) => {

к тому же arr это ведь не массив, у него нет forEach

Comment thread hw7script.js Outdated
alert(str.toLocaleUpperCase());
// Exrecise 2
function searchStart(arr, subString) {
const arr = {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тебе не нужен этот объект, у тебя все что нужно передается аргументами, используй их

Comment thread hw7script.js Outdated
product: ["яблоко", "груша", "гриб", "огурец"],
building: ["Дом", "Банк", "Больница", "Театр"],
};
const search = "ко";
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

у тебя это аргумент subString

Comment thread hw5script.js
}
// Как сделать с prompt?
};
alert(evenNum(7));
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alert(evenNum(prompt('введите число')));

Comment thread hw7script.js
alert(element);
}
});
return null;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

возваращай arr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants